<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<html>
<head>
<link rel="stylesheet" href="../css/css.css" type="text/css" />
<script type="text/javascript" src="../js/jquery-1.7.2.js" ></script>
<script type="text/javascript">

		   function exeDel(sel_id){
		     var params="maintainID="+sel_id;
		     $.ajax({
		       url:'delMaintainManage.action', //后台处理程序
		       type:'post',         //数据发送方式
		       dataType:'text',     //接受数据格式
		       data:params,         //要传递的数据
		       timeout: 3000,
		       error: function(){
		         alert('访问删除功能出错!');
		     	},
		       success: function(json){
		         alert(json);
		         document.location.reload();
		     	}
		     });
		   }

var  highlightcolor='#d5f4fe';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE" || source.tagName=="TH" || source.id=="no_changecol")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(var i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(var i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}
</script>
</head>
<body>
	<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
        <TR>
          <TD><strong>当前位置：管理员后台 &gt; 保养信息管理 &gt; 保养信息浏览</strong></TD></TR>
        <TR>
          <TD height=2></TD></TR></TABLE>
		<table width="100%" border=0 align=center cellpadding=2 cellspacing=1
			bordercolor="#799AE1" class=tableBorder onMouseOver="changeto()"  onmouseout="changeback()">
			<tbody>
				<tr>
					<th align=center colspan=16 style="height: 23px">保养信息浏览</th>
				</tr>
				<tr bgcolor="#DEE5FA">
					<td  id="no_changecol" height="25" colspan="16"  class=txlrow>
					<table width="332" border="0">
					<s:form action="selectMaintainManage.action">
						<tr>
							<td id="no_changecol" width="111">
							<s:select list="#{'0':'--选择--','1':'品牌'}" name="selectField" ></s:select>
							</td>
							<td id="no_changecol" width="168">
								<s:textfield name="selectValue"></s:textfield>
							</td>
							<td id="no_changecol" width="39"><input type="submit"
								 value="查询">
							</td>
						</tr>
					</s:form>
					</table></td>
				</tr>
				<tr  align="center" bgcolor="#799AE1">
					<td height="25" id="no_changecol"   align="center" class="txlHeaderBackgroundAlternate">序号</td>
					<td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>品牌</td>
					<td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>机油价格</td>
					<td id="no_changecol"   align="center" class=txlHeaderBackgroundAlternate>滤清器价格</td>
                    <td id="no_changecol"   align="center" class=txlHeaderBackgroundAlternate>火花塞价格</td>
                    <td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>机油(12月)</td>
                    <td id="no_changecol"   align="center" class=txlHeaderBackgroundAlternate>机油(24月)</td>
                    <td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>机油(36月)</td>
                    <td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>滤清器(12月)</td>
                    <td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>滤清器(24月)</td>
                    <td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>滤清器(36月)</td>
                    <td id="no_changecol"    align="center" class=txlHeaderBackgroundAlternate>火花塞(12月)</td>
                    <td id="no_changecol"   align="center" class=txlHeaderBackgroundAlternate>火花塞(24月)</td>
                    <td id="no_changecol"   align="center" class=txlHeaderBackgroundAlternate>火花塞(36月)</td>
					<td id="no_changecol" colspan="2" align="center" class=txlHeaderBackgroundAlternate >操作</td>
				</tr>
<s:iterator value="maintainList" var="dep" status="stat">
				<tr bgcolor="#DEE5FA">
					<td align="center" class="txlrow"><s:property value="#stat.count"/></td>
					<td align=center class=txlrow><s:property value="#dep.brand"/></td>
					<td align=center class=txlrow><s:property value="#dep.oilPrice"/></td>
                    <td align=center class=txlrow><s:property value="#dep.lvPrice"/></td>
                    <td align=center class=txlrow><s:property value="#dep.firePrice"/></td>
                    <td align=center class=txlrow><s:property value="#dep.oilA"/></td>
                    <td align=center class=txlrow><s:property value="#dep.oilB"/></td>
                    <td align=center class=txlrow><s:property value="#dep.oilC"/></td>
                    <td align=center class=txlrow><s:property value="#dep.lvA"/></td>
                    <td align=center class=txlrow><s:property value="#dep.lvB"/></td>
                    <td align=center class=txlrow><s:property value="#dep.lvC"/></td>
                    <td align=center class=txlrow><s:property value="#dep.fireA"/></td>
                    <td align=center class=txlrow><s:property value="#dep.fireB"/></td>
                    <td align=center class=txlrow><s:property value="#dep.fireC"/></td>
					<td   align=center class=txlrow><s:url id="updateVal" action="showupdateMaintainManage.action"><s:param name="maintainID" value="#dep.id"></s:param></s:url><s:a href="%{updateVal}">修改</s:a></td>
					<td  align=center class=txlrow><a href="#"  onclick="exeDel('<s:property value="#dep.id"/>')">删除</a></td>
				</tr>
</s:iterator>
				<tr bgcolor="#DEE5FA">
					<td id="no_changecol" colspan=16 align=center class=txlrow></td>
				</tr>
				</tbody>
		</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="33%"><div align="left"><span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong> ${count}</strong> 条记录，每页显示<strong> ${pageSize}</strong> 条，当前第<strong> ${pageNum}</strong> 页，共 <strong>${pageCount}</strong> 页</span></div></td>
        <td width="67%"><table width="312" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="49"><div align="center"><s:a href="selectMaintainManage.action?pageNum=1"><img border="0" src="../images/main_54.gif" width="40" height="15" /></s:a></div></td>
            <td width="49"><div align="center"><s:a href="selectMaintainManage.action?pageNum=%{pageNum-1}"><img border="0" src="../images/main_56.gif" width="45" height="15" /></s:a></div></td>
            <td width="49"><div align="center"><s:a href="selectMaintainManage.action?pageNum=%{pageNum+1}"><img border="0" src="../images/main_58.gif" width="45" height="15" /></s:a></div></td>
            <td width="49"><div align="center"><s:a href="selectMaintainManage.action?pageNum=%{pageCount}"><img border="0" src="../images/main_60.gif" width="40" height="15" /></s:a></div></td>
            <td width="37" class="STYLE22"><div align="center">转到</div></td>
            <td width="22"><div align="center">
              <input type="text" name="textfield" id="gotoPageNum" maxlength="6" style="width:25px; height:15px; font-size:12px; border:solid 1px #7aaebd;"/>
            </div></td>
            <td width="22" class="STYLE22"><div align="center">页</div></td>
            <td width="35"><img onClick="gotoSels()" border="0" src="../images/main_62.gif" width="26" height="15" /></td>
          </tr>
        </table></td>
      </tr>
    </table>
	<script language="javascript">
		function gotoSels()
		{
			var gv = document.getElementById("gotoPageNum").value;
			var patrn = "^[0-9]*[1-9][0-9]*$";
			if(gv.match(patrn)){
				document.location.href="selectMaintainManage.action?pageNum="+gv;
			}else{
				alert("请输入一个正整数!");
			}
		}
	</script>

</BODY>
</HTML>